﻿@model Model.tb_Device
@{
    ViewBag.Title = "doDeviceInfo";
}
<!DOCTYPE html>

<head>
    <meta name="viewport" content="width=device-width" />
    <title>仪器设备</title>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/themes/default/easyui.css")'>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/themes/icon.css")'>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/demo.css")'>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/uploader/uploadify.css")' />
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/Validform/style.css")'  />
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-1.8.2.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-easyui/jquery.easyui.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-easyui/locale/easyui-lang-zh_CN.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/uploader/jquery.uploadify.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/uploader/swfobject.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/MicrosoftAjax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/MicrosoftMvcAjax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/Validform/Validform_v5.3.2_min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/My97DatePicker/WdatePicker.js")'></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#buyDate').click(function () { WdatePicker() });
            $('#useDate').click(function () { WdatePicker() });
            $('#lastVerificationDate').click(function () { WdatePicker() });
            $('#nextVerificationDate').click(function () { WdatePicker() });
            /*页面控件验证*/
            $("#name").attr("datatype", "*");
            //$("#type").attr("datatype", "*");
            //$("#pCode").attr("datatype", "*");
            //$("#eCode").attr("datatype", "*");
            //$("#buyDate").attr("datatype", "*");
            //$("#useDate").attr("datatype", "*");
            //$("#price").attr("datatype", "*");
            //$("#depercitionNum").attr("datatype", "*");
            //$("#verificationNum").attr("datatype", "*");
            //$("#lastVerificationDate").attr("datatype", "*");
            $("#verificationResult").attr("datatype", "*");
            //$("#nextVerificationDate").attr("datatype", "*");
            $("#technologyStatus").attr("datatype", "d");
            $("#unit").attr("datatype", "d");
            //$("#companyId").attr("datatype", "d");
            //$("#userId").attr("datatype", "d");
            $("#uploadfrm").Validform({
                tiptype: 3
            });
            /*结束 页面控件验证*/
        });
        function handle(e) {
            if (e == "1") {
                window.parent.$('#dgtable').datagrid("reload");
                alert("保存成功！");
                $('#dlg').dialog('close');
            } else {
                alert("保存失败！");
            }
        }
        function failed(e) {
            alert("保存失败！");
        }
    </script>
    <style type="text/css">
        .divList {
            position: absolute;
            top: 40px;
            left: 1px;
            z-index: 99;
            width: 1048px;
        }

        a {
            text-decoration: none;
            color: #000;
        }

            a img {
                border: 0;
            }

        .biaoge {
            width: 1040px;
            font-family: '宋体';
            font-size: 12px;
            color: #10607c;
        }

            .biaoge td {
                text-align: center;
                height: 26px;
                vertical-align: middle;
                border: 1px solid #d4d3d3;
            }

        .data_tab02 {
            height: 22px;
            margin: 0px;
            padding-left: 2px;
            background: url(Content/Images/tab_bg02.gif) repeat-x;
        }

            .data_tab02 dd {
                width: 100px;
                height: 22px;
                line-height: 22px;
                float: left;
                text-align: center;
                cursor: pointer;
                margin-right: 2px;
            }

                .data_tab02 dd a {
                    display: block;
                    clear: both;
                    background: url(../../Content/Images/dlbeijing.png);
                    width: 100px;
                    height: 25px;
                    color: #FFFFFF;
                    font-size: 13px;
                }

                    .data_tab02 dd a:hover {
                        color: #ff9c00;
                    }

                    .data_tab02 dd a:focus {
                        color: #ff9c00;
                    }
    </style>
</head>
<body>
    @using (Ajax.BeginForm("doDeviceCU", "Device", new AjaxOptions { HttpMethod = "Post", OnSuccess = "handle", OnFailure = "failed" }, new { @id = "uploadfrm" }))
    {
        @Html.HiddenFor(m => m.id)
        @Html.HiddenFor(m => m.createDate, new { @id = "createDateE" })
        @Html.HiddenFor(m => m.createUser, new { @id = "createUserE" })
        @Html.HiddenFor(m => m.temp1, new { @id = "temp1E" })
        @Html.HiddenFor(m => m.temp2, new { @id = "temp2E" })
        @Html.HiddenFor(m => m.amount, new { @id = "totalE" })
        @Html.HiddenFor(m => m.updateDate, new { @id = "updateDateE" })
        @Html.HiddenFor(m => m.updateUser, new { @id = "updateUserE" })
        <table align="left" height="300px" style="font-family: '宋体'; font-size: 12px;">
            <tr>
                <td width="90px" align="right">设备（仪器）名称：</td>
                <td align="left">@Html.TextBoxFor(m => m.name)</td>
                <td width="90px" align="right">规格型号：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.type)
                </td>
            </tr>
            <tr>
                <td width="90px" align="right">单位：</td>
                <td align="left">@Html.DropDownListFor(m => m.unit,ViewData["ddl_unit"] as SelectList)</td>
                <td width="90px" align="right"></td>
                <td align="left"></td>
            </tr>
            <tr>
                <td width="90px" align="right">资产编号：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.pCode)
                </td>
                <td width="90px" align="right">设备编号：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.eCode)
                </td>
            </tr>
            <tr>
                <td width="90px" align="right">购置日期：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.buyDate)
                </td>
                <td width="90px" align="right">启用日期：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.useDate)
                </td>
            </tr>
            <tr>
                <td width="90px" align="right">原值（元）：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.price)
                </td>
                <td width="90px" align="right">折旧年限：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.depercitionNum)
                </td>
            </tr>
            <tr>
                <td width="90px" align="right">检定周期：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.verificationNum)
                </td>
                <td width="90px" align="right">上次检定日期：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.lastVerificationDate)
                </td>
            </tr>
            <tr>
                <td width="90px" align="right">检定结论：</td>
                <td align="left">
                    @{
        List<SelectListItem> list = new List<SelectListItem>();
        list.Add(new SelectListItem() { Text = "请选择", Value = "" });
        list.Add(new SelectListItem() { Text = "合格", Value = "合格" });
        list.Add(new SelectListItem() { Text = "不合格", Value = "不合格" });
                    }
                    @Html.DropDownListFor(m => m.verificationResult, list)
                </td>
                <td width="90px" align="right">下次检定日期：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.nextVerificationDate)
                </td>
            </tr>
            <tr>
                <td width="90px" align="right">技术状态：</td>
                <td align="left">
                    @{
                            List<SelectListItem> listSelectListItem = new List<SelectListItem>();
                            listSelectListItem.Add(new SelectListItem() { Text = "请选择", Value = "-1" });
                            listSelectListItem.Add(new SelectListItem() { Text = "WH", Value = "1" });
                            listSelectListItem.Add(new SelectListItem() { Text = "DB", Value = "2" });
                            listSelectListItem.Add(new SelectListItem() { Text = "ZX", Value = "3" });
                            listSelectListItem.Add(new SelectListItem() { Text = "DF", Value = "4" });
                            listSelectListItem.Add(new SelectListItem() { Text = "XZ", Value = "5" });
                            listSelectListItem.Add(new SelectListItem() { Text = "WS", Value = "6" });
                            
                    }
                    @Html.DropDownListFor(m => m.technologyStatus, new SelectList(listSelectListItem,"Value","Text"))
                </td>
                <td width="90px" align="right">存在问题及部位：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.problem)
                </td>
            </tr>
            <tr>
                <td width="90px" align="right">使用单位：</td>
                <td align="left">
                    @Html.DropDownListFor(m => m.companyId, ViewData["ddl_company"] as SelectList)
                </td>
                <td width="90px" align="right">使用人：</td>
                <td align="left">
                    @Html.TextBoxFor(m => m.userId)
                </td>
            </tr>
            <tr>
                <td colspan="4" align="center">
                    <a href="javascript:void(0)" onclick="$('#uploadfrm').submit()">
                        <img src="~/Content/Images/baocun.png" height="20px" /></a>
                    <a href="javascript:void(0)" onclick="window.parent.$('#dlg').dialog('close')">
                        <img src="~/Content/Images/fanhui.png" height="20px" />
                    </a></td>
            </tr>
        </table>
    }
</body>
